import request from '@/utils/request'

export function getPositionPagedList(query) {
  return request({
    url: `/api/business/positions_admin/`,
    method: 'get',
    params: query
  })
}

export function getPosition(id) {
  return request({
    url: `/api/business/positions_admin/${id}/`,
    method: 'get'
  })
}

export function createPosition(data) {
  return request({
    url: `/api/business/positions_admin/`,
    method: 'post',
    data
  })
}

export function updatePosition(id, data) {
  return request({
    url: `/api/business/positions_admin/${id}/`,
    method: 'put',
    data
  })
}

export function deletePosition(id) {
  return request({
    url: `/api/business/positions_admin/${id}/`,
    method: 'delete'
  })
}

export function changeDisplayOrder(id, data) {
  return request({
    url: `/api/business/positions_admin/${id}/change_display_order/`,
    method: 'put',
    data
  })
}

export function getPositionList(query) {
  return request({
    url: `/api/business/positions/`,
    method: 'get',
    params: query
  })
}
